package m10;

import m07.Ship;
import m07.Good;
import static org.junit.Assert.*;
import org.junit.Test;

/**
 * 
 * @author Samantha Rich
 * This class test the method Contains() to ensure
 * that is properly checks the ship's cargo for
 * a good.
 *
 */
public class ContainsTest {
	//A ship object of type flea
	Ship ship= new Ship("Flea", 10);
	
	//Create 10 new Good objects to test 
	Good gwater = new Good ("Water", 0, 0, 30, 3, 4, "LOTSOFWATER", "DESERT", 30, 50, 0);
	Good gfurs = new Good ("Furs", 0, 0, 250, 10, 10, "RICHFAUA", "LIFELESS", 230, 280, 0);
	Good gfood = new Good ("Food", 1, 0, 100, 5, 5, "RICHSOIL", "POORSOIL", 90, 160, 0);
	Good gore = new Good ("Ore", 2, 2, 350, 20, 10, "MINERALRICH", "MINERALPOOR", 350, 420, 0);
	Good ggames = new Good ("Games", 3, 1, 250, -10, 5, "ARTISTIC", null, 160, 270, 0);
	Good gfire = new Good ("Firearms", 3, 1, 1250, -75, 100, "WARLIKE", null, 600, 1100, 0);
	Good gmeds = new Good ("Medicine", 4, 1, 650, -20, 10, "LOTSOFHERBS", null, 400, 700, 0);
	Good gmachine = new Good ("Machines", 4, 3, 900, -30, 5, null, null, 600, 800, 0);
	Good gnarc = new Good ("Narcotics", 5, 0, 3500, -125, 150, "WEIRDMUSHROOMS", null, 2000, 3000, 0);
	Good grobot = new Good ("Robots", 6, 4, 5000, -150, 100, null, null, 3500, 5000, 0);
	
	@Test
	/**
	 * This method does not add Robots to the 
	 * cargo hold before it checks the good amount
	 * There should be 0 robots in the hold. 
	 * @result true
	 */
	public void testMissingRobots(){
		assertEquals(ship.getGoodAmount("Robots"), "0", "0");
	}
	
	@Test
	/**
	 * Adds water to the cargo, and checks that
	 * there is ONLY 1 water contained in the hold. 
	 * @result true
	 */
	public void testContainsWater(){
		ship.addCargo(gwater);
		assertEquals(ship.getGoodAmount("Water"), "1", "1");
	}
	
	@Test
	/**
	 * Adds Fur to the cargo, and checks that
	 * there is ONLY 1 fur contained in the hold. 
	 * @result true
	 */
	public void testContainsFurs(){
		ship.addCargo(gfurs);
		assertEquals(ship.getGoodAmount("Furs"), "1", "1");
	}
	
	@Test
	/**
	 * Adds food to the cargo, and checks that
	 * there is ONLY 1 food good contained in the hold. 
	 * @result true
	 */
	public void testContainsFood(){
		ship.addCargo(gfood);
		assertEquals(ship.getGoodAmount("Food"), "1", "1");
	}
	
	@Test
	/**
	 * Adds ore to the cargo, and checks that
	 * there is ONLY 1 ore contained in the hold. 
	 * @result true
	 */
	public void testContainsOre(){
		ship.addCargo(gore);
		assertEquals(ship.getGoodAmount("Ore"), "1", "1");
	}
	
	@Test
	/**
	 * Adds a games good to the cargo, and checks that
	 * there is ONLY 1 game contained in the hold.  
	 * @result true
	 */
	public void testContainsGames(){
		ship.addCargo(ggames);
		assertEquals(ship.getGoodAmount("Games"), "1", "1");
	}
	
	@Test
	/**
	 * Adds a firearm good to the cargo, and checks that
	 * there is ONLY 1 firearm contained in the hold. 
	 * @result true
	 */
	public void testContainsFire(){
		ship.addCargo(gfire);
		assertEquals(ship.getGoodAmount("Fire"), "1", "1");
	}
	
	@Test
	/**
	 * Adds meds to the cargo, and checks that
	 * there is ONLY 1 med contained in the hold. 
	 * @result true
	 */
	public void testContainsMeds(){
		ship.addCargo(gmeds);
		assertEquals(ship.getGoodAmount("Meds"), "1", "1");
	}
	
	@Test
	/**
	 * Adds machines to the cargo, and checks that
	 * there is ONLY 1 machine contained in the hold. 
	 * @result true
	 */
	public void testContainsMachines(){
		ship.addCargo(gmachine);
		assertEquals(ship.getGoodAmount("Machines"), "1", "1");
	}
	
	@Test
	/**
	 * Adds narcotics to the cargo, and checks that
	 * there is ONLY 1 narcotic contained in the hold.  
	 * @result true
	 */
	public void testContainsNarc(){
		ship.addCargo(gnarc);
		assertEquals(ship.getGoodAmount("Narcotics"), "1", "1");
	}
	
	
	
}
